﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApp2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            SqlConnection sql = new SqlConnection();
            SqlCommand sql1 = new SqlCommand();
            sql1.CommandText = "select * from user";
            sql.Open();

            int i = sql1.ExecuteNonQuery();

            sql.Close();

            if(i > 0)
                Console.WriteLine("添加成功!");
            else
                Console.WriteLine("添加失败!");
            Console.ReadKey();
        }
    }
}
